import * as React from 'react';
import { connect } from 'dva';
import { Button } from 'antd';


@connect((count: number) => count)
class Test extends React.PureComponent<any, object> {
    constructor(props: any) {
        super(props);
    }
    public render() {
        const { count, dispatch } = this.props;
        return (
            <div>
                <h2>{count}</h2>
                <Button key="add" onClick={() => { dispatch({ type: 'count/add' }) }}>+</Button>
                <Button key="minus" onClick={() => { dispatch({ type: 'count/minus' }) }}>-</Button>
            </div>
        );
    }
}

export default Test;
